home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d6
/
glazer.arc
/
SAVHISTO.BAS
< prev
next >
Wrap
BASIC Source File
|
1988-10-07
|
1KB
|
34 lines
100 'Savings History ("SAVHISTORY")
110 CLS
120 COLOR 0,15 : PRINT "Savings History" : COLOR 15,0
130 DEFDBL A-Z
140 DEFINT M-N, Y
150 MONEYFMT$ = "$$##,###,###.##"
160 PRINT
170 ' Let user enter data
180 PRINT "Do not enter dollar signs or commas"
190 PRINT
200 INPUT "Initial deposit: ", DEPOSIT
210 INPUT "Annual growth rate in deposits (in percent): ", DEPOSITGROWTH
220 INPUT "Annual interest rate (in percent): ", AR
230 INPUT "Number of years: ", NYEARS
240 INPUT "Annual inflation rate (in percent): ", INFLATION
250 INPUT "Marginal tax rate (in percent): ", TAXRATE
260 ' Initialize variables
270 RAFTERTAX = AR * (100 - TAXRATE) / 10000 'After-tax interest rate
280 BALANCE = DEPOSIT 'Initial balance
290 PRINT: PRINT "Press space bar to see next year's results"
300 PRINT
310 ' Do yearly calculations
320 FOR YEAR = 1 TO NYEARS
330 WHILE INKEY$ = "" : WEND 'Wait for user to press a key
340 PRINT :PRINT "Year: "; YEAR
350 ADJUSTEDBAL = BALANCE * (1 + INFLATION / 100) ^ -YEAR
360 'Print results
370 PRINT "Nominal balance "; TAB(30); USING MONEYFMT$; BALANCE
380 PRINT "Inflation-adjusted balance"; TAB(30); USING MONEYFMT$; ADJUSTEDBAL
390 'Next year's results
400 BALANCE = BALANCE * (1 + RAFTERTAX) + DEPOSIT * (1 + DEPOSITGROWTH / 100) ^ YEAR
410 NEXT YEAR
420 END